package com.myxf;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.View.OnClickListener;

public class MainActivity extends AppCompatActivity implements OnClickListener{

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        findViewById(R.id.tv_read).setOnClickListener(this);
        findViewById(R.id.tv_write).setOnClickListener(this);
        findViewById(R.id.tv_all).setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        Intent intent = null;
        switch (view.getId()){
            // 语音转写
            case R.id.tv_write:
                intent = new Intent(MainActivity.this, WriteDemo.class);
                break;
            // 语音合成
            case R.id.tv_read:
                // 语音合成
                intent = new Intent(MainActivity.this, ReadDemo.class);
                break;
            case R.id.tv_all:
                intent = new Intent(MainActivity.this, WriteToReadDemo.class);
                break;
            default:
                break;
        }
        if (intent != null) {
            startActivity(intent);
        }
    }
}
